<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br" lang="pt-br">
    <head>
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
        <?php echo $this->headTitle() ?>
        <?php echo $this->headLink() ?>
        <?php echo $this->headScript() ?>
    </head>
    <?php //flush(); ?>
    <body>
    
        <!-- Header -->
        <div id="header">
            <h1>
                <a href="#">RECADASTRAMENTO</a>
                <span>Prefeitura Municipal de Fortaleza</span>
            </h1>
            
            <div id="usuario">
                Bem-vindo, <strong><?php echo $this->user->nome; ?></strong> |
                <a href="<?php echo $this->url(array("controller"=>"auth", "action"=>"logout")); ?>">Sair</a><br />
                Data: <strong id="current-date"><?php echo date('d/m/Y h:i'); ?></strong> | Versão: <strong><?php echo $this->versao; ?></strong>
            </div>
        </div>
        
        <!-- Container -->
        <div id="container">
            <div id="menu">
                <ul>
                    <li>
                        <span>
                        <?php if(in_array(1,$this->permissoes)){
                        	echo "Cadastros";
                        }
                        
                        ?>
                        </span>
                        <ul>
                            <?php if (in_array(2,$this->permissoes)) { ?>
                            <li><a href="<?php echo $this->url(array("controller"=>"usuarios", "action"=>"index"), null, true);?>">Usuários</a></li>
                            <?php } ?>
                            <?php if (in_array(3,$this->permissoes)) { ?>
                            <li><a href="<?php echo $this->url(array("controller"=>"perfil", "action"=>"index"), null, true);?>">Perfis</a></li>
                            <?php } ?>
                            <?php if (in_array(4,$this->permissoes)) { ?>
                            <li><a href="<?php echo $this->url(array("controller"=>"funcionalidades", "action"=>"index"), null, true);?>">Funcionalidades</a></li>
                            <?php } ?>
                            
                        </ul>
                    </li>
                    <li>
                        <span>
                        <?php if(in_array(5,$this->permissoes)){
                        	echo "Recadastro";
                        }
                        
                        ?>
                        </span>
                        <ul>
                            <?php if (in_array(6,$this->permissoes)) { ?>
                            <li><a href="<?php echo $this->url(array("controller"=>"recadastro", "action"=>"atualizacao"), null, true);?>">Dados do Servidor</a></li>
                            <?php } ?>
                            <?php if (in_array(9,$this->permissoes)) { ?>
                            <li><a href="<?php echo $this->url(array("controller"=>"representante", "action"=>"index"), null, true);?>">Representante Legal</a></li>
                            <?php } ?>
                        	<?php if (in_array(7,$this->permissoes)) { ?>
                            <li><a href="<?php echo $this->url(array("controller"=>"recadastro", "index"), null, true);?>">Listar Servidores</a></li>
                            <?php } ?>
                            
                        </ul>
                    </li>
                </ul>
            </div>
	          
            <div id="section">
                <?php if (is_array($this->messages) && count($this->messages > 0)): ?>
                <?php foreach ($this->messages as $msg) : ?>
                <div class='message notice'><?php echo $msg;?></div>
                <?php endforeach; ?>
                <?php endif; ?>
				<?php echo $this->layout()->content ?>
            </div>     
        </div>
        
        <!-- Footer -->
        <div id="footer">
            <p>
                RECADASTRAMENTO &mdash; 
                <a href="http://www.fortaleza.ce.gov.br">Prefeitura Municipal de Fortaleza</a>
            </p>
            
            <address>Suporte: Ligue 3452.3476</address>
        </div>
        
    </body>
</html>